﻿{include file="/public/header" /}
{include file="/public/navbar" /}
<div class="page">
    <div class="page__bd">
        <div class="weui-cells">
            <a aria-labelledby="js_cell_itl1_hd js_cell_itl1_bd js_cell_itl1_ft" class="weui-cell weui-cell_access" href="/index">
                <span class="weui-cell__bd" aria-hidden="true">
                    <span style="color:gray;">返回首页</span>
                </span>
                <span class="weui-cell__ft" aria-hidden="true"></span>
            </a>
        </div>
        <div class="weui-panel weui-panel_access">
            <div class="weui-panel__bd">
                <!--{if ($b['wd'] ?? NULL)}-->
                <a aria-labelledby="js_cell_itl1_hd js_cell_itl1_bd js_cell_itl1_ft" class="weui-cell weui-cell_access weui-cell_example" href="/withdraw/index">
                    <span class="weui-cell__hd" aria-hidden="true">
                        <i role="img" title="提示" aria-describedby="tip_2" class="weui-icon-info weui-icon_msg" style="width:30px;margin-right:5px; display: block;"></i>
                    </span>
                    <span class="weui-cell__bd" aria-hidden="true">
                        <span style="color:red;font-weight:bold;">您已有提现在申请付款中，请耐心等待！</span>
                    </span>
                </a>
                <a aria-labelledby="js_p1m1_bd" href="javascript:" class="weui-media-box weui-media-box_appmsg">
                    <div aria-hidden="true" class="weui-media-box__hd" style="width:50px;height:50px;">
                        <img class="weui-media-box__thumb" src="/static/{$Think.config.app.APPSKEY ?? ''}/images/yongjin.png" alt="">
                    </div>
                    <div aria-hidden="true" id="js_p1m1_bd" class="weui-media-box__bd">
                        <strong class="weui-media-box__title" style="line-height:2;color:#fa9d3b;font-weight:bold;">￥{$b['wd']['amount'] ?? '0.00'}</strong>
                        <p class="weui-media-box__desc" style="color:{$b['wd']['statecolor'] ?? 'gray'};">{$b['wd']['statename'] ?? ''}(<i>{$b['wd']['dateline'] ?? ''}</i>)</p>
                    </div>
                </a>
                <!--{else}-->
                <a aria-labelledby="js_p1m1_bd" href="javascript:" class="weui-media-box weui-media-box_appmsg">
                    <div aria-hidden="true" class="weui-media-box__hd" style="width:110px;height:110px;">
                        <img class="weui-media-box__thumb" src="/static/{$Think.config.app.APPSKEY ?? ''}/images/yongjin.png" alt="">
                    </div>
                    <div aria-hidden="true" id="js_p1m1_bd" class="weui-media-box__bd">
                        <strong class="weui-media-box__title" style="line-height:2;color:#fa9d3b;font-weight:bold;">￥{$b['amount'] ?? '0.00'}</strong>
                        <p class="weui-media-box__desc">可提现佣金</p>
                    </div>
                </a>
                <!--{/if}-->
            </div>
        </div>
        <div class="weui-cells">
            <a class="weui-cell  weui-cell_access" href="/withdraw">
                <span class="weui-cell__bd">
                    <span>我的提现申请</span>
                </span>
                <span class="weui-cell__ft" style="font-size:x-small;">详情</span>
            </a>
            <a class="weui-cell  weui-cell_access" href="/member">
                <span class="weui-cell__bd">
                    <span>我的提现账户</span>
                </span>
                <span class="weui-cell__ft" style="font-size:x-small;">详情</span>
            </a>
        </div>
        <!--{if !($b['wd'] ?? 0) AND ($b['amount'] ?? 0) > 0}-->
        <form name="form" method="post" class="weui-form" style="padding:0 !important;">
            <div class="weui-cells">
                <label for="amount" class="weui-cell weui-cell_active">
                    <div class="weui-cell__hd"><span class="weui-label require" style="color:#07c160;font-weight:bold;">提现金额(元)</span></div>
                    <div class="weui-cell__bd"><input id="amount" name="amount" class="weui-input" value="" data-min="{$minamt ?? '0.00'}" data-max="{$b['amount'] ?? '0.00'}" maxlength="20" placeholder="填写提现金额"></div>
                </label>
            </div>
            <div class="weui-form__opr-area" style="margin:30px 0 50px 0">
                <a role="button" class="weui-btn weui-btn_primary" wah-hotarea="click" onclick="return Sys.DForm(this);">确定提交</a>
            </div>
        </form>
        <!--{/if}-->
    </div>
</div>
<script type="text/javascript">
Sys.DForm = function(o){
    let form = $(o).parents('form');
    let p = {
        'amount'   : form.find('input[name="amount"]').val(),
    }
    if (!Sys.rule('money',p['amount'])) {
        weui.topTips('填写正确的提现金额',1500);return false;
    }
    let minamt = form.find('input[name="amount"]').attr('data-min');
    let maxamt = form.find('input[name="amount"]').attr('data-max');
    if (!Sys.rule('money',minamt) || !Sys.rule('money',maxamt)) {
        weui.topTips('可提现金额错误',1500);return false;
    } else if (parseFloat(p['amount']) < parseFloat(minamt)) {
        weui.topTips('提现金额必须超过'+minamt+'元',1500);return false;
    } else if (parseFloat(p['amount']) > parseFloat(maxamt)) {
        weui.topTips('金额超出可提现金额',1500);return false;
    }
    form.submit();
    return true;
}
$(document).ready(function (){

});
</script>
{include file="/public/footer" /}